<template>
	<view class="mall-v-block">
		<mall-block-title :title="title" class="title"></mall-block-title>
		<view class="block" >
			<mall-v-item @click.native="toDetail(item.id)"  v-for='(item,index) in items' :goods="item" :class='{right:index%2!=0}' :key='index' class='item'></mall-v-item>
		</view>
	</view>
</template>

<script>
	import mallBlockTitle from '../mall-block-title/mall-block-title.vue'
	import mallVItem from '../mall-v-item/mall-v-item.vue'
	export default {
		props:{
			items:Array,
			title:String
		},
		components:{
			mallBlockTitle,mallVItem
		},
		methods:{
			toDetail(id){
				
				this.$Router.push({
					path: '/pages/mall/detail'	,
					query:{
						id:id
					}
				});
			}	
		},
		data() {
			return {
			
			};
		}
	}
</script>

<style lang="stylus">
	.mall-v-block
		height 100%
		.block
			padding 0 20rpx
			display flex
			flex-wrap wrap
			justify-content space-between
			.item
				.right
					margin-left 10rpx
				
</style>
